<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>分类管理</title>
    <script type="text/javascript" src="http://127.0.01/jmshop/Static/js/jquery-1.7.2.min.js"></script>
    <link rel="stylesheet" href="http://127.0.01/jmshop/Static/bootstrap/css/bootstrap.min.css" />
    <!-- <link rel="stylesheet" href="http://127.0.01/jmshop/Static/bootstrap/css/bootstrap-theme.min.css" /> -->
    <link rel="stylesheet" type="text/css" href="http://127.0.01/jmshop/Static/hdjs/hdjs.css">
    <script type="text/javascript" src="http://127.0.01/jmshop/Static/hdjs/hdjs.min.js"></script>
    <script type="text/javascript">
        $(function(){
            // alert(1);
            $('tr[pid!="0"]').hide();
            //+++++++点击加号缩回子分类++++++++++++
            $('.plus_minus').toggle(function(){
                $(this).removeClass('glyphicon-plus').addClass('glyphicon-minus');
                var cid = $(this).parents('tr').attr('cid');
                $('tr[pid='+cid+']').show();
            },function(){
                var cid = $(this).parents('tr').attr('cid');
                $('tr[pid='+cid+']').hide();
                $(this).removeClass('glyphicon-minus').addClass('glyphicon-plus');
            })

        })

    </script>
    <style type="text/css">
        .plus_minus{
            width: 20px;
        }
    </style>
    
</head>
<body>
<div class="wrap">
    <table class="hd-table hd-table-form hd-form">
        <thead>
        <tr pid="0">
            <td width="30"></td>
            <td>分类id</td>
            <td>分类名称</td>
            <td>分类排序</td>
            <td width="200">操作</td>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($categoryData as $k=>$v){?>
            <tr cid="<?php echo $v['cid'];?>" pid="<?php echo $v['pid'];?>">
                <td width="30">
                    <a href="javascript:;" class="plus_minus glyphicon glyphicon-plus"></a>
                </td>
                <td><?php echo $v['cid'];?></td>
                <td><?php echo $v['_name'];?></td>
                <td><?php echo $v['sort'];?></td>
                <td width="300">
                    <a href="<?php echo U('Admin/ShopCategory/add_son',array('cid'=>$v['cid']));?>" class="hd-btn hd-btn-primary hd-btn-sm">添加子分类</a>
                    <a href="<?php echo U('Admin/ShopCategory/edit_son',array('cid'=>$v['cid']));?>" class="hd-btn hd-btn-danger hd-btn-sm">修改</a>
                    <a href="<?php echo U('Admin/ShopCategory/del',array('cid'=>$v['cid']));?>" class="hd-btn hd-btn-success hd-btn-sm">删除</a>
                </td>
            </tr>
        <?php }?>
        </tbody>
        
    </table>
    <div class="page_hdjob">
        
    </div>
</div>

</body>
</html>


